﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Clinic.Ioc
{
    public interface IServiceRegistry
    {
        IServiceRegistry RegisterInstance(Type type, object instance);

        IServiceRegistry RegisterInstance(Type type, object instance, string name);

        IServiceRegistry RegisterSingleton(Type from, Type to);

        IServiceRegistry RegisterSingleton(Type from, Type to, string name);

        IServiceRegistry RegisterSingleton(Type type, Func<object> factoryMethod);

        IServiceRegistry RegisterSingleton(Type type, Func<IServiceProvider, object> factoryMethod);

        IServiceRegistry RegisterManySingleton(Type type, params Type[] serviceTypes);

        IServiceRegistry Register(Type from, Type to);

        IServiceRegistry Register(Type from, Type to, string name);

        IServiceRegistry Register(Type type, Func<object> factoryMethod);

        IServiceRegistry Register(Type type, Func<IServiceProvider, object> factoryMethod);

        IServiceRegistry RegisterMany(Type type, params Type[] serviceTypes);

        IServiceRegistry RegisterScoped(Type from, Type to);

        IServiceRegistry RegisterScoped(Type type, Func<object> factoryMethod);

        IServiceRegistry RegisterScoped(Type type, Func<IServiceProvider, object> factoryMethod);

        bool IsRegistered(Type type);

        bool IsRegistered(Type type, string name);
    }
}
